package nayasis.common.util;

import junit.framework.Assert;

import org.junit.Test;

public class ValidatorTest {

    @Test
    public void isNum() {
        Assert.assertTrue( Validator.isNumber( "12345" ) );
        Assert.assertTrue( Validator.isNumber( "-12345" ) );
        Assert.assertFalse( Validator.isNumber( "- 12345" ) );
        Assert.assertFalse( Validator.isNumber( "A12345" ) );
    }

    @Test
    public void hasNum() {
        
        Assert.assertTrue( Validator.hasNumber( "A12BCD" ) );
        Assert.assertFalse( Validator.hasNumber( "ABCD" ) );
    }

    @Test
    public void isNumeric() {
        Assert.assertTrue( Validator.isNumeric( "-1234567890" ) );
        Assert.assertTrue( Validator.isNumeric( "-123456789099123012938120398102983123.2" ) );
    }
    
}
